package com.iqiyi.pps.epg.core.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by karkarrotxu on 2018/4/20.
 */
public final class RecordUtil {
//    public static void main(String[] args){
//        System.out.println(decodeRepeatCode(254));
//    }
    public static List<Integer> decodeRepeatCode(int value) {
        int start = 2;
        int i = 1;
        List<Integer> list = new ArrayList<Integer>();
        while (value >= start) {
            if ((value & start) == start) {
                list.add(i);
            }
            start = start << 1;
            i++;
        }
        return list;
    }
}
